<?php
/**
 * Created by PhpStorm.
 * User: Teddy
 * Date: 16/1/5
 * Time: 上午12:07
 */

if(session_status() != PHP_SESSION_ACTIVE) {
    session_start();
}
if($_SESSION["usr"] == null || $_SESSION["usr"] == "") {
    header("location:Error.html");
}
else{

    /*Load JMX file
    $file = 'BackEnd/PhpApi.jmx';
    if(file_exists($file)) {
        $xml = simplexml_load_file($file);
        $HTTPSamplerProxys = $xml->HTTPSamplerProxy;

        foreach ($HTTPSamplerProxys as $HTTPSamplerProxy) {
            $testname = (String)$HTTPSamplerProxy["testname"];
            echo ($testname);
        }
    }*/
}
?>

<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="21 cake Api test">
        <meta name="author" content="Teddy Long">
        <!--ICON-->
        <link rel="icon" href="favicon.ico" type="image/x-icon" />
        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

        <title>21 Cake API Test Manage</title>

        <!--BootStrap Component-->
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/bootstrap-theme.min.css" rel="stylesheet">
        <link href="css/bootstrap-table.min.css" rel="stylesheet" >
        <link href="css/bootstrap-editable.css" rel="stylesheet">
        <link href="css/ionicons.css" rel="stylesheet">
        <link href="css/theme.css" rel="stylesheet" >

    </head>

    <body role="document">
        <nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand" href="index.php">21 Cake Api Test</a>
                </div>
                <div id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="index.php">Home</a></li>
                    </ul>
                </div>
            </div>
        </nav>
        <div class="container" role="main">
            <!--Case Manage Label-->
            <div>
                <div class="info-box bg-green" style="width: 100%">
                    <span class="info-box-icon"><span style="margin-top:11px;" class="ion ion-ios-pricetag-outline"></span></span>
                    <div class="info-box-content">
                        <span class="info-box-text">Case Management</span></span>
                    </div>
                </div>
            </div>
            <!--Case List-->
            <div><h3>TBD</h3></div>

            <!--Server Manage Label-->
            <div>
                <div class="info-box bg-green" style="width: 100%">
                    <span class="info-box-icon"><span style="margin-top:11px;" class="ion ion-ios-pricetag-outline"></span></span>
                    <div class="info-box-content">
                        <span class="info-box-text">Server Management</span>
                    </div>
                </div>
            </div>
            <!--Server List-->
            <div>
                <table id="ServerTable"
                       data-toggle="table"
                       data-url="getTestServer.php">
                    <thead>
                    <tr>
                        <th data-halign="center" data-align="center" data-field = "id">ID</th>
                        <th data-halign="center" data-align="center" data-field= "ip" data-editable="true">IP</th>
                        <th data-halign="center" data-align="center" data-field= "category" data-editable="true">Category</th>
                        <th data-halign="center" data-align="center" data-field="action" data-formatter="actionFormatter" data-events="actionEventsServer">Action</th>
                    </tr>
                    </thead>
                </table>
            </div>

            <!--User Manage Label-->
            <div>
                <div class="info-box bg-green" style="width: 100%">
                    <span class="info-box-icon"><span style="margin-top:11px;" class="ion ion-ios-pricetag-outline"></span></span>
                    <div class="info-box-content">
                        <span class="info-box-text">User Management</span>
                    </div>
                </div>
            </div>
            <!--User List-->
            <div>
                <table id="UserTable"
                       data-toggle="table"
                       data-url="getTestUser.php">
                    <thead>
                    <tr>
                        <th data-halign="center" data-align="center" data-field="id">ID</th>
                        <th data-halign="center" data-align="center" data-field="name" data-editable="true">Name</th>
                        <th data-halign="center" data-align="center" data-field="pwd" data-editable="true">Password</th>
                        <th data-halign="center" data-align="center" data-field="action" data-formatter="actionFormatter" data-events="actionEventsUser">Action</th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <!--JS LOAD-->
        <script src="js/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/bootstrap-table.min.js"></script>
        <script src="js/bootstrap-table-editable.js"></script>
        <script src="js/bootstrap-editable.js"></script>
        <script src="js/Manage.js"></script>
    </body>
</html>